﻿/*
 * KLF Headless Browser
 * Written by Kris Oye <kristianoye@gmail.com>
 * Copyright (C) 2011-2012.  All rights reserved.
 */
namespace KLF.Lib.Browser.DOM.Interface
{
    public abstract class UserDataHandlerOperation
    {
        public const short NODE_CLONED = 1;
        public const short NODE_IMPORTED = 2;
        public const short NODE_DELETED = 3;
        public const short NODE_RENAMED = 4;
        public const short NODE_ADOPTED = 5;
    }

    public interface IUserDataHandler
    {
        #region DOM Level 3 Compliance

        /// <summary>
        /// This method is called whenever the node for which this handler is
        /// registered is imported or cloned.
        /// 
        /// DOM applications must not raise exceptions in a UserDataHandler. 
        /// The effect of throwing exceptions from the handler is DOM 
        /// implementation dependent. 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="key"></param>
        /// <param name="data"></param>
        /// <param name="src"></param>
        /// <param name="dst"></param>
        void handle(short operation, string key, object data, Node src, Node dst);

        #endregion
    }
}
